package com.zy.swagger.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * description 钉钉资源接口
 *
 * @author ZY
 * @date 2021年04月03日 21:25
 **/

public class DingTalkResource {

    /**
     * 用于存放钉钉token
     */
    public static Map<String, String> tokenMap = new HashMap<>();

    /**
     * 缓存中钉钉token的key
     */
    public static final String TOKEN_KEY = "DingToken";

    /**
     * 钉钉接口返回正常的状态码
     */
    public static final int DD_OK = 0;

    /**
     * 获取钉钉token接口地址
     */
    public static final String GET_DING_TOKEN_URL = "https://oapi.dingtalk.com/gettoken?appkey=%s&appsecret=%s";

    /**
     * 获取钉钉所有部门接口地址
     */
    public static final String GET_DING_DEPT_LIST_URL = "https://oapi.dingtalk.com/department/list?access_token=%s&fetch_child=true";

    /**
     * 获取钉钉指定部门的子部门ID集合地址
     */
    public static final String GET_DING_SUB_DEPT_ID_LIST_URL = "https://oapi.dingtalk.com/topapi/v2/department/listsubid?access_token=%s";

    /**
     * 根据部门ID获取部门下面用户地址
     */
    public static final String GET_DEPT_USERS_URL = "https://oapi.dingtalk.com/user/simplelist?access_token=%s&department_id=%d";

    /**
     * 钉钉考勤接口
     */
    public static final String GET_DING_ATTENDANCE_URL = "https://oapi.dingtalk.com/attendance/list?access_token=%s";
}
